home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / info-service / gopher / Unix / gopher1.12 / object / DAarray.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-12-30  |  1.5 KB  |  65 lines

  1. /********************************************************************
  2.  * $Author: lindner $
  3.  * $Revision: 1.2 $
  4.  * $Date: 1992/12/21 20:04:04 $
  5.  * $Source: /home/mudhoney/GopherSrc/release1.11/object/RCS/DAarray.h,v $
  6.  * $State: Rel $
  7.  *
  8.  * Paul Lindner, University of Minnesota CIS.
  9.  *
  10.  * Copyright 1991, 1992 by the Regents of the University of Minnesota
  11.  * see the file "Copyright" in the distribution for conditions of use.
  12.  *********************************************************************
  13.  * MODULE: DAarray.h
  14.  * Dynamic Array Header file/abstraction
  15.  *********************************************************************
  16.  * Revision History:
  17.  * $Log: DAarray.h,v $
  18.  * Revision 1.2  1992/12/21  20:04:04  lindner
  19.  * Added DAcpy()
  20.  *
  21.  * Revision 1.1  1992/12/10  23:27:52  lindner
  22.  * gopher 1.1 release
  23.  *
  24.  *
  25.  *********************************************************************/
  26.  
  27.  
  28. #ifndef DAARRAY_H
  29. #define DAARRAY_H
  30.  
  31. /*
  32.  *  A dynamic array class
  33.  */ 
  34.  
  35. struct da_struct {
  36.      char **objects;  /** Should be void** perhaps */
  37.      
  38.      int Top;
  39.      int maxsize;
  40.  
  41.      char * (*newfn)();
  42.      void   (*initfn)();
  43.      void   (*destroyfn)();
  44.      char * (*copyfn)();
  45. };
  46.  
  47. typedef struct da_struct DynArray;
  48.  
  49. #define DAgetEntry(a,b)   (((a)->objects[b]))
  50. #define DAgetTop(a)       ((a)->Top)
  51. #define DAsetTop(a,b)     ((a)->Top=(b))
  52. #define DAgetNumitems(a)   ((a)->Top)
  53.  
  54. DynArray *DAnew();
  55. void     DAdestroy();
  56. void     DAinit();
  57. void     DApush();
  58. char *   DApop();
  59. void     DAsort();
  60. void     DAgrow();
  61. void     DAsort();
  62. void     DAcpy(/* dest, orig */);
  63. #endif
  64.  
  65.